﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.CUiAPPGroupHeaderConverter
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using C1.WPF.FlexGrid;
using DnProcessSimulateCommands.AutomaticPathPlanner;
using System;
using System.Globalization;
using System.Windows.Data;


namespace DnProcessSimulateCommands;

public class CUiAPPGroupHeaderConverter : IValueConverter
{
  public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  {
    CollectionViewGroup group = (parameter as GroupRow).Group;
    if (group.ItemCount <= 0 || !(group.Items[0] is CApAPPWaypoint))
      return group.Name;
    CApAPPWaypoint capAppWaypoint = group.Items[0] as CApAPPWaypoint;
    if (!(capAppWaypoint.Task is CApAPPRoboticTask task))
      return (object) capAppWaypoint.Task.Name;
    string str = !CApAPPUtilities.CanUseRCSForRobot(task.Robot) ? CApAPPMainWindowStringTable.RoboticTaskMOPAddendumName : CApAPPMainWindowStringTable.RoboticTaskRRSAddendumName;
    return (object) (capAppWaypoint.Task.Name + str);
  }

  public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  {
    throw new NotImplementedException();
  }
}
